GTI Custom - Users Multi-Templates Choice
For Zen Cart 1.3.9c
Written in May 29, 2010
About This Template
This is a modifcation of the original Multi-Template For Users by 'cse031sust02'
The differences are that there is no LOADING... Page, Only Registered Users of your Store may use this mod and the template that your user chooses, is written into 2 new fields in the Customer table of the database so even if they use a different computer, they will get their template choice. You can also use this with your currently installed templates too.
Install Users Multi-Templates Choice
First make a BACKUP of the Core Files that have been modified and your DATABASE.
The core files are:
/includes/modules/pages/login/header_php.php.
/includes/classes/template_func.php.
To install this mod, merge the files from the includes file into yours. Remember to copy the file user_index.php to the root of your STORE folder, above the includes folder. Next, install the SQL changes to the Customer Table in the database. This adds 2 fields to the customers table in your store database.
The default template will be your STORES DEFAULT TEMPLATE. REMEMBER to EDIT the file multi_template_customers.sql and change the template name in the 2 lines here (in bold):
ALTER TABLE `customers` ADD `customers_template` VARCHAR( 25 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT 'YOUR_DEFAULT_TEMPLATE';
UPDATE `customers` SET `customers_template` = 'YOUR_DEFAULT_TEMPLATE',`customers_language` = 1 WHERE `customers`.`customers_id` > 0;
In your Admin Screen go to Tools - Layout Boxes Controller and turn on the sideboxes/user_template. I would have it displayed near the top of your column. Remember, turn it on in all of your existing Templates particularly your DEFAULT TEMPLATE that you added in the sql file!
When the User logs off, your Default Template will be reloaded because no Registered User is online, so it defaults back to your default template.The UnRegistered Store User will get the Default Template and not be able to change it unless they register in your store.
TopUnInstall Users Multi-Templates Choice
To uninstall the User Template Mod, simply turn off the user_template sidebox. If you want to delete everything that was added, replace the core files with your backups. To remove the SQL entries, BACKUP YOUR DATABASE FIRST then upload or copy and paste the uninstall.sql file into your Admin Install SQl Patches area. This will remove the 2 new fields from the customers template and once again set them to your default template.
Files Used in Users Multi-Templates Selection
Support Thread located here.
Copyright © 2010 JT of GTI Custom